package com.yfp.operation.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yfp.operation.domain.DeviceCurrentComboStockDO;
import com.yfp.operation.domain.dto.ComboSoldOutDTO;
import com.yfp.operation.domain.vo.DeviceCurrentComboStockVO;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @description 针对表【device_current_combo_stock】的数据库操作Mapper
 * @createDate 2024-04-24 15:36:52
 * @Entity com.yfp.operation.domain.DeviceCurrentComboStock
 */
public interface DeviceCurrentComboStockMapper extends BaseMapper<DeviceCurrentComboStockDO> {


    /**
     * 获取设备商品投放情况
     * @param machineId 设备id
     * @return
     */
    List<DeviceCurrentComboStockDO> getComboCase(String machineId);


    List<DeviceCurrentComboStockVO> getComboCount(String machineId);

    DeviceCurrentComboStockDO selectByMachineIdAndComboId(String machineId, String comboId);

    void deleteByMachineId(String deviceId);

    void updateStock(DeviceCurrentComboStockDO aDo);

    void batchUpdate(@Param("dccsList") ArrayList<DeviceCurrentComboStockDO> dccsList);

    void insertAll(@Param("dccsList") List<DeviceCurrentComboStockDO> dccsList);

    /**
     * 根据套餐计划id和套餐id删除套餐信息
     * @param comboSoldOutDTO
     */
    void deleteByCPlanIdAndComboId(ComboSoldOutDTO comboSoldOutDTO);

    /**
     * 获取线上库存信息
     * @param machineId
     * @return
     */
    List<DeviceCurrentComboStockDO> getByMacineId(String machineId);
}
